package com.zhp.constant;

import lombok.NonNull;

/**
 * @author zhanghp
 * @since 2024/5/28 9:58
 */
public class RedisFailMsg {

    // ====================错误提示=========================================

    public static final String FAIL_SET_EXPIRE = "Failed to set expire time for key[%s], timeout[%s]";

    public static final String FAIL_GET_EXPIRE = "Failed to get expire time for key[%s]";

    public static final String FAIL_GET_EXISTS_KEY = "Failed to get exists key[%s]";

    public static final String FAIL_DEL_KEY = "Failed to del key[%s]";

    public static final String FAIL_DEL_COLLECTION_KEYS = "Failed to del collection keys[%s]";

    // ========================String 相关错误提示==================================
    public static final String FAIL_STRING_SET = "Failed to set String key[%s] value[%s]";

    public static final String FAIL_STRING_EXPIRE_SET = "Failed to set String key[%s] value[%s] timeout[%s]";

    public static final String FAIL_STRING_SET_NX_EXPIRE = "Failed to set nx String key [%s], value[%s], timeount[%s]";

    public static final String FAIL_STRING_SET_NX = "Failed to set nx String key [%s], value[%s]";

    public static final String FAIL_STRING_INCR_DELTA = "Failed to increment String key [%s], delta[%s]";

    public static final String FAIL_STRING_INCR = "Failed to increment String key [%s]";

    public static final String FAIL_STRING_DECR_DELTA = "Failed to decrement String key [%s], delta[%s]";

    public static final String FAIL_STRING_DECR = "Failed to decrement String key [%s]";

    // ===================================哈希 相关错误提示 ===================================

    public static final String FAIL_HASH_SET = "Failed to set Hash key[%s] field[%s] value[%s]";

    public static final String FAIL_HASH_SET_COLLECTION = "Failed to set Hash key[%s] map[%s]";

    public static final String FAIL_HASH_GET = "Failed to get Hash key[%s] field[%s]";

    public static final String FAIL_HASH_GET_ALL = "Failed to get Hash key[%s]";

    public static final String FAIL_HASH_DEL = "Failed to del Hash key[%s] field[%s]";

    public static final String FAIL_HAS_HASH_KEY = "Failed to exists Hash key[%s] field[%s]";



    public static String format(@NonNull String msg, Object... args) {
        return String.format(msg, args);
    }
}
